There are many options for resize, move and copy the run boxes.
These options can be set for the whole Gantt column or for individual rows.
Individual boxes have set their moving and resizing permissions by their type in the GanttRun definition:
Box (normal), Fixed (not movable, not resizable), Left (not movable, resizable only right side),
Right (not movable, resizable only left side), Solid (not resizable), for more information see previous tutorial.
All these dragging attributes (GanttRunResize, GanttRunMove, GanttRunAdjust, GanttRunNew, GanttRunNewStart) can have different values when dragging with shift key (Ctrl, Shift, Alt) and with other mouse button (Right, Middle).
The value is set by attribute with appropriate suffix, it can be combined mouse button and shift key, the shift key suffix is before the mouse button.
For example GanttRunResizeCtrl, GanttRunMoveRight, GanttRunAdjustShiftMiddle.
GanttRunResize
attribute controls how the boxes are resized.
Now there is only one way of resizing boxes, by dragging its edge, so this attribute sets only resizing permissions -
empty value means no resizing, "Resize" for resizing resizable boxes, "All" for resizing all boxes. Default value is "Resize".
The box can be deleted by resizing to zero width when set
GanttResizeDelete
='1' (default setting).
GanttRunMove
attribute controls how the boxes are moved or copied inside or outside the row. It controls the source row for dragging.
To restrict moving at all, set GanttRunMove to empty string.
Default is "Slide" to shift the box left or right only inside its row. It cannot change the box order, except GanttRunAdjust contains "Error".
"Move" moves the box inside or outside the row. The original place of the box is filled by empty space.
"Remove" moves the box inside or outside the row. The original place of the box is deleted and the other boxes in row are shifted according to GanttRunAdjust setting.
"Copy" copies the box to the new position inside or outside the row. The original box remains unchanged.
Calls API event OnGanttRunBoxNew, here you can change especially box Id, because it is duplicate of the original box.
There are also other flags controlling which boxes will be moved.
"All" - also fixed boxes can be moved.
"Single" - by default are the joined boxes together, if used "Single", it moves only the one actual box.
GanttRunAdjust
attribute controls how the other boxes will behave, when some box is shifted inside, dropped to or removed from the row.
It controls also how the dropped box will be updated. It controls the destination row for dragging.
The GanttRunAdjust can have different values for GanttRunMove / GanttRunResize actions. These options are set by the attribute with appropriate postfix:
GanttRunAdjustResize, GanttRunAdjustSlide, GanttRunAdjustMove, GanttRunAdjustRemove, GanttRunAdjustCopy. Remember, the order of the keywords is important. For example "Move,Resize" means that the box is first tried to move and next, only if it still cannot be placed, tries to resize it. And the "Resize,Move" will behave differently.
Empty value - When set nothing, the box will be moved within surrounding empty space only.
Default is "Shift" - The box will be moved or resized within surrounding empty space and if required, the next or previous boxes will be shifted and their empty spaces preserved.
"Shrink" - The box will be moved or resized within surrounding empty space and if required, the next or previous boxes will be shifted and their empty spaces shrunk.
"Slip" - The next or previous boxes will be shifted, all empty spaces will be preserved, including the adjacent.
There are also other flags controlling which boxes can be moved.
"All" - also fixed boxes can be moved.
"Single" - when there are more adjacent boxes without space, the surrounding space will be taken as none, especially for Shift and Slip. If not present, the surrounding space is taken as the nearest space.
"Append" - when dragged to box edge, attaches it to the box without space as adjacent – the boxes will be joined.
Flags controlling how the source box will be changed if there is no room for it.
"Error" - the box will be moved or resized even if there is no room for it, in this case it will be marked as error.
The attribute
GanttRunError
controls behavior of error boxes.
If set GanttRunError='Sort' (default value), the boxes will be sorted according to their start date.
The boxes are sorted also on start.
If set GanttRunError='Merge', the boxes will be merged together. Only Box and Solid boxes are merged.
"Resize" - the box will be resized if there is no room for it.
"Move" - the box will be moved left if there is no room for it (also shifting boxes on left side by Shift/Shrink/Slip will be permitted).
"Zoom" - when moving between grids, the box will have the same width on screen and its physical width will be changed by difference between zoom in the grids.
GanttRunNew
attribute defines the new box that will be created when dragging on empty space.
It has the same format as the GanttRun definition except Start / End items.
It can define also more boxes to create more boxes at once, only the first box will be resized when dragging the new box while creating.
GanttRunNewStart
attribute defines the new box(es) when creating new box in empty cell. It is possible to add here also Start / End boxes to be created too.